package cn.com.simple.learning.designpattern.behavior.observer;

/**
 * @author jjx
 * @date 2021/7/20 16:10
 */
public class FirstObserver extends Observer {

    private final Topic topic;

    public FirstObserver(Topic topic) {
        this.topic = topic;
        this.topic.register(this);
    }

    @Override
    public void update() {
        System.out.println("FirstObserver " + this.topic.getState());
    }
}
